< previous page page_205 next page >

Page 205
Heres the output:
9f31265bb40b592b1929e18a47ab28e5.gif
3/24/95

3
24
1995
1
6
The first parameter to the DatePart() function is a string that specifies which part you want to retrieve. There are many of these different strings you can pass. See the online help for more information. The 2nd parameter to this function is a valid date/time variable.
Date Arithmetic
When you have a variant Date type, you can add and subtract any amount of days between two dates. Simply use the plus and minus operators. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdArith_Click ()
   Dim dtDate As Date

   Me.Cls
   ' Get System Date/Time
   dtDate = Now

   Me.Print dtDate
   Print
   Me.Print dtDate + 1
   Me.Print dtDate - 1
End Sub
Heres the output:
9f31265bb40b592b1929e18a47ab28e5.gif
3/24/95

3/25/95
3/23/95

 
< previous page page_205 next page >

If you like this book, buy it!